package io.github.tangwan.thread;

/**
 * @author tangwan
 * @version V1.0
 * created on 2021/10/8 11:12
 * @since JDK 1.8
 */
public class MyThread2 {

    public static void main(String[] args) {
        for (int i = 0; i < 10; i++) {
            new Thread(){
                @Override
                public void run() {
                    System.out.println(Thread.currentThread().getName());
                }
            }.start();
        }

        for (int i = 0; i < 10; i++) {
            new Thread(new Runnable() {
                @Override
                public void run() {
                    System.out.println(Thread.currentThread().getName());
                }
            }).start();
        }

    }

}
